<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}EI Power问题管理系统{% endblock %}</title>
    <link href="{{ url_for('static', filename='css/bootstrap.min.css') }}" rel="stylesheet">
    <link href="{{ url_for('static', filename='css/bootstrap-icons.css') }}" rel="stylesheet">
    <style>
        .navbar-brand {
            font-weight: bold;
        }
        .feedback-card {
            transition: transform 0.2s;
        }
        .feedback-card:hover {
            transform: translateY(-2px);
        }
        .status-badge {
            font-size: 0.8em;
        }
        .footer {
            padding: 20px 0;
            margin-top: 50px;
        }
        .footer-content {
            display: flex;
            justify-content: center;
            align-items: center;
            flex-wrap: wrap;
            gap: 10px;
            color: #6c757d;
            font-size: 14px;
        }
        .footer-content p {
            margin: 0;
        }
        .footer-content a {
            color: #6c757d;
            text-decoration: none;
        }
        .footer-content a:hover {
            color: #495057;
            text-decoration: underline;
        }
        .footer-content .divider {
            margin: 0 5px;
        }
        .footer-content img {
            width: 16px;
            height: 16px;
            margin: 0 5px;
            vertical-align: middle;
        }
    </style>
</head>
<body>
    <!-- 导航栏 -->
    {% if current_user.is_authenticated %}
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary">
        <div class="container">
            <a class="navbar-brand" href="{{ url_for('dashboard') }}">
                <i class="bi bi-chat-square-text"></i> EI Power问题管理系统
            </a>
            
            <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
                <span class="navbar-toggler-icon"></span>
            </button>
            
            <div class="collapse navbar-collapse" id="navbarNav">
                <ul class="navbar-nav me-auto">
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('dashboard') }}">
                            <i class="bi bi-house"></i> 仪表盘
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('submit_feedback') }}">
                            <i class="bi bi-plus-circle"></i> 提交问题
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('history') }}">
                            <i class="bi bi-clock-history"></i> 历史记录
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('all_proposals') }}">
                            <i class="bi bi-collection"></i> 所有问题
                        </a>
                    </li>
                    {% if current_user.is_admin %}
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('admin_panel') }}">
                            <i class="bi bi-gear"></i> 问题管理
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="{{ url_for('notification_logs') }}">
                            <i class="bi bi-envelope-check"></i> 通知日志
                        </a>
                    </li>
                    {% endif %}
                </ul>
                
                <ul class="navbar-nav">
                    <li class="nav-item dropdown">
                        <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-bs-toggle="dropdown">
                            <i class="bi bi-person-circle"></i> {{ current_user.username }}
                        </a>
                        <ul class="dropdown-menu">
                            <li><a class="dropdown-item" href="{{ url_for('logout') }}">
                                <i class="bi bi-box-arrow-right"></i> 退出登录
                            </a></li>
                        </ul>
                    </li>
                </ul>
            </div>
        </div>
    </nav>
    {% endif %}
    
    <!-- 主要内容 -->
    <main class="container mt-4">
        <!-- 消息提示 -->
        {% with messages = get_flashed_messages() %}
            {% if messages %}
                {% for message in messages %}
                    <div class="alert alert-info alert-dismissible fade show" role="alert">
                        <i class="bi bi-info-circle"></i> {{ message }}
                        <button type="button" class="btn-close" data-bs-dismiss="alert"></button>
                    </div>
                {% endfor %}
            {% endif %}
        {% endwith %}
        
        {% block content %}{% endblock %}
    </main>
    
    <!-- 页脚 -->
    <footer class="footer mt-auto">
        <div class="footer">
            <div class="footer-content">
                <span>&copy; 2025 EI Power - 问题管理系统 浙江机电职业技术大学&嘉兴智晤科技有限公司</span>
                <span class="divider">|</span>
                <a href="https://beian.miit.gov.cn/" target="_blank">浙ICP备2025156561号</a>
                <span class="divider">|</span>
                <img src="https://tjh666.cn/images/headlogo.png" alt="公安备案图标">
                <a href="https://beian.mps.gov.cn/#/query/webSearch?code=33068302000370" rel="noreferrer" target="_blank">浙公网安备33068302000370号</a>
            </div>
        </div>
    </footer>
    
    <script src="{{ url_for('static', filename='js/bootstrap.bundle.min.js') }}"></script>
    {% block scripts %}{% endblock %}
</body>
</html>